function registerInPlaceEditor(field, id) {
    new Ajax.InPlaceEditor(field+'td',
        'saveProfileField.action', {
        callback: function(form, value) { return 'id='+id+'&field='+field+'&value='+encodeURIComponent(value) },                                      okButton: false,
        submitOnBlur: true,
        externalControl: field+'EditLink',
        okLink: true,
        cancelButton: false,
        cancelLink: true,
        clickToEditText: 'Нажмите для редактирования',
        rows: 1,
        loadingText: 'Подождите...',
        textBeforeControls: '',
        textBetweenControls: ' | ',  // will not be used, as one control only
        textAfterControls: '',
        ajaxOptions: {method: 'getparameters:'} //override so we can use a static for the result
        });
}

function registerInPlaceCollectionEditor(field, id) {
    new Ajax.InPlaceCollectionEditor(field+'td',
    'saveProfileField.action', {
    loadCollectionURL: field+'List.action',
    callback: function(form, value) { return 'id='+id+'&field='+field+'&value='+encodeURIComponent(value) },
    submitOnBlur: true,
    externalControl: field+'EditLink',
    okButton: false,
    okLink: true,
    cancelButton: false,
    cancelLink: true,
    clickToEditText: 'Нажмите для редактирования',
    rows: 1,
    loadingText: 'Подождите...',
    textBeforeControls: '',
    textBetweenControls: ' | ',  // will not be used, as one control only
    textAfterControls: '',
    ajaxOptions: {method: 'getparameters:'} //override so we can use a static for the result
    });
}